#!/bin/bash

#备份所有的数据到文件里面

command="$1";

# 执行备份    mysqldump --host="localhost" --port=3306 --user="root" --password="root"  yii_shop  > models/backup.sql

if [ $command == "d2f" ]
then
    mysqldump --host="localhost" --port=3306 --user="root" --password="root"  yii_shop  > assets/backup.sql
elif [ $command == "f2d" ]
then
    mysql --host="localhost" --port=3306 --user="root" --password="root"  yii_shop  < assets/backup.sql
else
    echo "请输入指令d2f,f2d"
fi
